
% Pseudo-DCG specification of styles as used by class conception_node in Conception v3 (SWIPL version).  

/* STYLESHEET for style/3 clauses */

Style_specification ==> style(Style_id,Style_role,Style_attribute_values)
Style_id ==> int
Style_role ==> root|concept|arclabel|arclink1|arclink2|arclink12
Style_attribute_values ==> Node_attribute_values|Link_attribute_values

Node_attribute_values ==>        					% For Style_role in root|concept|arclabel
	      [Node_shape_descriptor, Children, Label,			% Stylesheets should layout thus: 3,5,3,3 per line
	    	Text_width, Links, Note, Lab_display, Border, 
	     	Fill_colour:Edge_colour,  Text_colour:Text_bg_colour, Unused,
	     	Font_name, Font_size, Font_style]

Link_attribute_values ==>						% For Style_role in arclink1|arclink2|arclink12
	       Arclink1_attribute_values    				% node->label connections
	     | Arclink2_attribute_values    				% label->node connections
	     | Arclink12_attribute_values   				% single-link connections

Arclink1_attribute_values ==>
           	[Arrows, Line_colour, Child_arclabel_style_no, Thickness]
Arclink2_attribute_values ==>
		[Arrows, Line_colour, Thickness]
Arclink12_attribute_values ==>
		[Arrows, Line_colour, Label, Thickness]    		% Labels needed even though not shown
 

/* Attribute Node_shape_descriptor */

Node_shape_descriptor ==> Atomic_shape_descriptor 
                        | Compound_shape_descriptor

Atomic_shape_descriptor ==>                                             % These descriptors use default parameters
			    | oval_shape  
                            | roundbox_shape
                            | box_shape 
			    | arclabel_shape			        % Expected only for Style_role = arclabel
                           

Compound_shape_descriptor ==>
                            | oval_shape(Width, Height)       
                            | roundbox_shape(Width, Height)
                            | box_shape(Width, Height)
                            | arclabel_shape(Width, Height)
                            | promptbox_shape(Prompt,Font_name,Font_size,Font_style)
                            | sidebar_shape(Prompt,Font_name,Font_size,Font_style)
                            | picture_shape(Libname,Picname,Scalefactor)
 

Width ==> integer
Height ==> integer
Prompt ==> atom
Libname ==> Picture_library_folder_name | 'Non-library files'
Picname ==> Picture_library_file_base_name | Absolute_file_name    	% Absolute_file_name only for Libname = 'Non-library files'
Picture_library_folder_name ==> atom
Picture_library_file_base_name ==> atom
Absolute_file_name ==> atom


/* Attribute Children */

Children ==> list_of(ConceptExitArc_id:ChildConcept_id)  		% For Style_role in root|concept
	       | ArclabelExitArc_id 					% For Style_role =  arclabel      

ConceptExitArc_id ==> Style_id						% Style_id must have Style_role in  arclink1|arclink12
ChildConcept_id ==> Style_id					      	% Style_id must have Style_role in concept|root
ArclabelExitArc_id ==> Style_id					       	% Style_id must have Style_role = arclink2
 

/* Remaining Node_attribute_values */

Label ==> atom 								% Carets enforce linebreak
Text_width ==> int | auto
Links ==> [] | listof(Hyperlink)       
Note ==> atom
Lab_display ==> off | on
Border ==> none | normal | shadow                                   	% 'normal' is a 1-pixel border
Fill_colour ==> Colour
Edge_colour ==> Colour  
Text_colour ==> Colour
Text_bg_colour ==> Colour
Unused ==> atom                                                         % For future expansion. Currently 'nil'
Font_name ==> courier | helvetica | screen | symbol | times         	% Others may be supported                                                  
Font_size ==> int
Font_style ==> normal | italic | bold

Hyperlink ==> file(Absolute_file_name) | url(URL)
URL ==> atom

Colour ==>   x11_named_colour_atom                                      % Preferred. Use 'Utilities/colour_picker.pl' 
                                                                        % printout_colour_picker_colours/0 to list allowed names.
           | rgb(Colour_number,Colour_number,Colour_number)
Colour_number ==> int							% Must be in 0..65535. Choose multiples of 256


/* Link_attribute_values */

Arrows ==> forward|backward|off
Line_colour ==> Colour
Arclabel_style_no ==>  Style_id		   		                % Must be Style_id of a Style_role = arclabel
Thickness ==> 1 | 2 | 3 | 4						% Pixel width of line

 
 